package com.example.shop.user.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class BrowsingDateTimeRangeParam {
    public static final String RANGE_SQL =
            " " +
            "<choose>" +
                "<when test = 'ew.rangeParam != null'>" +
                    "browse_date &gt;= #{ew.rangeParam.from} " +
                    "and " +
                    "browse_date &lt;= #{ew.rangeParam.to} " +
                "</when>" +
                "<otherwise>" +
                " 1 " +
                "</otherwise>" +
            "</choose>" +
            " ";
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    LocalDateTime from;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    LocalDateTime to;
}
